Merge upstream apache/cassandra-java-driver 4.19.2 and bump version to 4.19.2.0#895
Draft
nikagra wants to merge 76 commits into
Draft
Merge upstream apache/cassandra-java-driver 4.19.2 and bump version to 4.19.2.0#895nikagra wants to merge 76 commits into
nikagra wants to merge 76 commits into
Conversation
patch by Lukasz Antoniak; reviewed by Andy Tolbert, and Bret McGuire for CASSANDRA-19635
patch by Lukasz Antoniak; reviewed by Bret McGuire for CASSANDRA-19635
Those repeated calls account for a non-negligible portion of my application CPU (0.6%) and can definitly be a final field so that it gets resolved only once per CqlRequestHandler. patch by Benoit Tellier; reviewed by Andy Tolbert, and Bret McGuire reference: apache#1623
patch by Stefan Miklosovic; reviewed by Michael Semb Wever for CASSANDRA-19854
DefaultBoundStatement#getRoutingKey has logic to infer the routing key when no one has explicitly called setRoutingKey or otherwise set the routing key on the statement. It however doesn't check for cases where nothing has been bound yet on the statement. This causes more problems if the user decides to get a BoundStatementBuilder from the PreparedStatement, set some fields on it, and then copy it by constructing new BoundStatementBuilder objects with the BoundStatement as a parameter, since the empty ByteBuffer gets copied to all bound statements, resulting in all requests being targeted to the same Cassandra node in a token-aware load balancing policy. patch by Ammar Khaku; reviewed by Andy Tolbert, and Bret McGuire reference: apache#1620
…ted future patch by Lukasz Antoniak; reviewed by Andy Tolbert, and Bret McGuire for JAVA-3167
patch by Lukasz Antoniak; reviewed by Bret McGuire reference: apache#1955
…allow subsequent tests to run patch by Henry Hughes; reviewed by Alexandre Dutra and Andy Tolbert for JAVA-3117
patch by Lukasz Antoniak; reviewed by Andy Tolbert and Chris Lohfink for JAVA-3149
patch by Lukasz Antoniak; reviewed by Bret McGuire reference: apache#1939
It might take some (small) time for callback handling when the throttler request proceeds to submission. Before this change, the throttler proceed request will happen while holding the lock, preventing other tasks from proceeding when there is spare capacity and even preventing tasks from enqueuing until the callback completes. By tracking the expected outcome, we can perform the callback outside of the lock. This means that request registration and submission can proceed even when a long callback is being processed. patch by Jason Koch; Reviewed by Andy Tolbert and Chris Lohfink for CASSANDRA-19922
…kReturnValue Since the driver's default implementation is for BatchStatement and SimpleStatement methods to be immutable, we should annotate those methods with @CheckReturnValue. Statement#setNowInSeconds implementations are immutable so annotate that too. patch by Ammar Khaku; reviewed by Andy Tolbert and Bret McGuire reference: apache#1607
patch by Bret McGuire; reviewed by Andy Tolbert and Alexandre Dutra reference: apache#1962
after exceeding max orphan ids patch by Christian Aistleitner; reviewed by Andy Tolbert, and Bret McGuire for apache#1938
patch by Siyao (Jane) He; reviewed by Mick Semb Wever for CASSANDRA-19832
patch by Lukasz Antoniak; reviewed by Bret McGuire and Chris Lohfink
patch by Abe Ratnofsky; reviewed by Andy Tolbert and Chris Lohfink for CASSANDRA-20001
patch by Bret McGuire; reviewed by Bret McGuire and Andy Tolbert for CASSANDRA-19930
If super.after() throws an Exception `CURRENT` flag is never dropped
which leads next tests to fail with IllegalStateException("Attempting to use a Ccm rule while another is in use. This is disallowed")
Patch by Dmitry Kropachev; reviewed by Andy Tolbert and Bret McGuire for JAVA-3117
patch by Jane He; reviewed by Alexandre Dutra and Bret McGuire for JAVA-3051
patch by Siyao (Jane) He; reviewed by Mick Semb Wever for CASSJAVA-25
… with DataStax HCD 1.0.0 patch by Lukasz Antoniak; reviewed by Bret McGuire reference: apache#1958
patch by Stefan Miklosovic; reviewed by Bret McGuire for CASSJAVA-2
…assandra versions. patch by Bret McGuire; reviewed by Bret McGuire for CASSJAVA-54
Updating the link to Jira. Previously we had a component in the CASSANDRA Jira project but now we have a project for each driver - in the case of Java, it's CASSJAVA. Added CASSJAVA to .asf.yaml patch by Jeremy Hanna; reviewed by Bret McGuire for CASSJAVA-61
patch by Lukasz Antoniak; reviewed by Alexandre Dutra and Bret McGuire for CASSJAVA-52
patch by Ammar Khaku; reviewed by Andy Tolbert and Bret McGuire reference: apache#1635
With some sysprops enabled this will actually be respected which completely borks Astra routing. patch by Bret McGuire; reviewed by Alexandre Dutra and Bret McGuire for CASSJAVA-55
This value is initialized at constructor time and marked final, so it can never change. There is no need to have access to this reference synchronized. Patch by Jason Koch; reviewed by Alexandre Dutra, Andy Tolbert and Jane He
Patch by Michael Karsten; reviewed by Abe Ratnofsky and Andy Tolbert for CASSJAVA-89
Following from 6d3ba47 this changes the throttler to a complete lock-free implementation. Update the related comments and README now that it is lock-free. Patch by Jason Koch; reviewed by Alexandre Dutra and Andy Tolbert
patch by Ivan Sopov; reviewed by Bret McGuire reference: apache#2049
patch by Kefu Chai; reviewed by Andy Tolbert and Bret McGuire reference: apache#1940
patch by Lukasz Antoniak; reviewed by Bret McGuire and Abe Ratnofsky for CASSJAVA-92
… custom payload patch by Jane He; reviewed by Abe Ratnofsky and Bret McGuire for CASSJAVA-97
patch by Bret McGuire; reviewed by Andy Tolbert
…throws "Duplicate Key" patch by Jane He; reviewed by Andy Tolbert and Lukasz Atoniak for CASSJAVA-116
patch by Bret McGuire; reviewed by Lukasz Antoniak and Andy Tolbert reference: apache#2062
…thub.com/apache/cassandra-java-driver into scylla-4.x-merge-4.19.2 Following conflict resolutions and additional changes were made: - Removed Apache-specific infrastructure files: .asf.yaml, Jenkinsfile-datastax, Jenkinsfile-asf, ci/create-user.sh, ci/run-tests.sh - Kept ScyllaDB groupId (com.scylladb) and version (4.19.0.10-SNAPSHOT) in pom.xml files - Kept ScyllaDB's more up-to-date library versions (netty, jackson, etc.) - Removed <parent>org.apache/apache</parent> from root pom.xml - Took upstream's lock-free ConcurrencyLimitingRequestThrottler implementation - Took upstream's CASSJAVA-80: SSL_ALLOW_DNS_REVERSE_LOOKUP_SAN config option - Took upstream's CASSJAVA-92: local DC in nodetool clientstats - Took upstream's CASSJAVA-97: RequestIdGenerator support - Took upstream's CASSJAVA-89: schema options for Cassandra 5.0 - Took upstream's SubnetAddressTranslator - Kept ScyllaDB's shard-aware channel logic in CqlRequestHandler - Kept BackendType.SCYLLA and ScyllaDB-specific test infrastructure - Kept ScyllaDB's CCM/Scylla version handling in CcmBridge - Kept ScyllaDB's README and documentation
7d42eee to
178e47c
Compare
- BasicLoadBalancingPolicy: add missing closing brace for getLocalRack() - DefaultLoadBalancingPolicy: remove unused ThreadLocalRandom import - OptionalLocalDcHelper: add missing LinkedHashSet import; restore correct checkLocalDatacenterCompatibility implementation from upstream - InitialNodeListRefresh: add missing Set import; add contactPoints field and constructor arg; restore upstream compute() logic - InitialNodeListRefreshTest: replace bad merge artifact with upstream 4.19.2 version (contactPoint1/contactPoint2 setup + ImmutableSet args) - CqlRequestHandler: rename logPrefix -> handlerLogPrefix in sendRequest() calls to session.getChannel() - manual/core/README.md: add request_id/* to toctree
178e47c to
bbc972c
Compare
There was a problem hiding this comment.
Pull request overview
This PR merges upstream apache/cassandra-java-driver changes up to tag 4.19.2 into the ScyllaDB fork branch and bumps the fork’s version to 4.19.2.0-SNAPSHOT, bringing in upstream fixes/features such as request ID generation, SAN reverse-lookup configurability, lock-free throttling, and new address translation utilities.
Changes:
- Bump all module versions to
4.19.2.0-SNAPSHOTand update build tooling (revapi plugin + config wiring, JDK21 test profile). - Add/merge upstream core features: request-id generator plumbing, SSL SAN reverse-lookup toggle, startup “driver baggage” (LBP metadata), lock-free request throttler, and new address translation helpers (Subnet translator, parsing utilities).
- Add/adjust tests and documentation to cover the new behaviors (request-id, subnet translator config, schema option changes).
Reviewed changes
Copilot reviewed 87 out of 88 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test-infra/revapi.json | Revapi API-compat configuration adjustments. |
| test-infra/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| README.md | Minor formatting/whitespace normalization. |
| query-builder/src/test/java/com/datastax/oss/driver/api/querybuilder/schema/CreateTableTest.java | Add coverage for new compression option variants. |
| query-builder/src/test/java/com/datastax/dse/driver/api/querybuilder/schema/CreateDseTableTest.java | Add compression option coverage + crc_check_chance option coverage. |
| query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/schema/RelationOptions.java | Add crc_check_chance option + new compression APIs; deprecate legacy ones. |
| query-builder/revapi.json | Revapi ignore rules update for query-builder module. |
| query-builder/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| pom.xml | Root version bump; revapi plugin upgrade/config; add enforcer plugin; add JDK21 test profile. |
| osgi-tests/src/test/java/com/datastax/oss/driver/internal/osgi/support/BundleOptions.java | OSGi test bundle provisioning updates. |
| osgi-tests/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| metrics/microprofile/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| metrics/micrometer/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| mapper-runtime/revapi.json | Revapi config tweak (regex escaping) + ignore list changes. |
| mapper-runtime/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| mapper-processor/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| manual/core/request_id/README.md | New manual section documenting request-id feature. |
| manual/core/README.md | Link the new request-id manual section. |
| manual/core/non_blocking/README.md | Update throttler lock-freedom guidance to reflect lock-free throttler changes. |
| manual/core/address_resolution/README.md | Document FixedHostName and Subnet address translators. |
| integration-tests/src/test/java/com/datastax/oss/driver/querybuilder/RelationOptionsIT.java | New IT verifying crc_check_chance + compression option behavior across Cassandra versions. |
| integration-tests/src/test/java/com/datastax/oss/driver/core/tracker/RequestNodeLoggerExample.java | Rename log prefix parameter for clarity (node vs session request prefix). |
| integration-tests/src/test/java/com/datastax/oss/driver/core/tracker/RequestIdGeneratorIT.java | New IT coverage for request-id generator + custom payload behavior. |
| integration-tests/src/test/java/com/datastax/oss/driver/core/ssl/DefaultSslEngineFactoryIT.java | New IT asserting SAN hostname resolution respects reverse-lookup config. |
| integration-tests/src/test/java/com/datastax/oss/driver/core/cql/PreparedStatementCachingIT.java | Adjust test prepare-cache behavior (avoid explicit CacheBuilder dependency). |
| integration-tests/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| guava-shaded/pom.xml | Version bump + make guava optional + build-helper logic to skip recompilation outside Java 8. |
| examples/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| distribution/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| distribution-tests/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| distribution-source/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| core/src/test/java/com/datastax/oss/driver/internal/core/util/ArrayUtilsTest.java | Update shuffle tests to mock Random instead of ThreadLocalRandom. |
| core/src/test/java/com/datastax/oss/driver/internal/core/type/codec/VectorCodecTest.java | Simplify array duplication using commons ArrayUtils. |
| core/src/test/java/com/datastax/oss/driver/internal/core/tracker/RequestIdGeneratorTest.java | New unit tests for UUID/W3C request id generators. |
| core/src/test/java/com/datastax/oss/driver/internal/core/cql/RequestHandlerTestHarness.java | Add request-id generator support in harness/context mocks. |
| core/src/test/java/com/datastax/oss/driver/internal/core/cql/QueryTraceFetcherTest.java | Make InetAddress deterministic (loopback) instead of mock. |
| core/src/test/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandlerRetryTest.java | New regression test for retry + request-id generator “duplicate key” scenario. |
| core/src/test/java/com/datastax/oss/driver/internal/core/context/StartupOptionsBuilderTest.java | Add tests for startup “driver baggage” including local DC / LBP details. |
| core/src/test/java/com/datastax/oss/driver/internal/core/context/MockedDriverContextFactory.java | Enhance factory to support multiple profiles and mock LBPs for startup baggage tests. |
| core/src/test/java/com/datastax/oss/driver/internal/core/context/DefaultDriverContextTest.java | Update factory usage after MockedDriverContextFactory changes. |
| core/src/test/java/com/datastax/oss/driver/internal/core/ContactPointsTest.java | Update warning message expectations for contact point parsing. |
| core/src/test/java/com/datastax/oss/driver/internal/core/config/typesafe/TypesafeDriverConfigTest.java | Add coverage for string-map keys that include forward slashes. |
| core/src/test/java/com/datastax/oss/driver/internal/core/config/MockOptions.java | Add SUBNET_ADDRESSES option for tests. |
| core/src/test/java/com/datastax/oss/driver/internal/core/addresstranslation/SubnetTest.java | New tests for Subnet CIDR parsing/contains logic. |
| core/src/test/java/com/datastax/oss/driver/internal/core/addresstranslation/SubnetAddressTranslatorTest.java | New tests for SubnetAddressTranslator behavior and validation. |
| core/src/test/java/com/datastax/oss/driver/internal/core/addresstranslation/SubnetAddressTest.java | New tests for overlap detection. |
| core/src/test/java/com/datastax/oss/driver/internal/core/addresstranslation/FixedHostNameAddressTranslatorTest.java | Update to use DefaultDriverOption constant and new context factory signature. |
| core/src/main/resources/reference.conf | Add config knobs for SAN reverse-lookup and request-id generator; document SubnetAddressTranslator config. |
| core/src/main/java/com/datastax/oss/driver/internal/core/util/ArrayUtils.java | Accept Random in shuffleHead overload (testability). |
| core/src/main/java/com/datastax/oss/driver/internal/core/util/AddressUtils.java | New helper to parse host:port (optionally resolve) used by contact points and subnet translator. |
| core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/registry/DefaultCodecRegistry.java | Optimize CacheKey.hashCode() to avoid allocations. |
| core/src/main/java/com/datastax/oss/driver/internal/core/tracker/W3CContextRequestIdGenerator.java | New W3C trace-context request id generator. |
| core/src/main/java/com/datastax/oss/driver/internal/core/tracker/UuidRequestIdGenerator.java | New UUID-based request id generator. |
| core/src/main/java/com/datastax/oss/driver/internal/core/tracker/RequestLogger.java | Rename log prefix parameter to distinguish session vs node scopes. |
| core/src/main/java/com/datastax/oss/driver/internal/core/tracker/NoopRequestTracker.java | Rename log prefix parameters to match new semantics. |
| core/src/main/java/com/datastax/oss/driver/internal/core/tracker/MultiplexingRequestTracker.java | Propagate renamed log prefix parameter through multiplexing tracker. |
| core/src/main/java/com/datastax/oss/driver/internal/core/ssl/SniSslEngineFactory.java | Add toggle to avoid DNS reverse lookups when selecting SAN host. |
| core/src/main/java/com/datastax/oss/driver/internal/core/ssl/DefaultSslEngineFactory.java | Add SAN hostname resolution toggle + test hooks; use configured hostname selection. |
| core/src/main/java/com/datastax/oss/driver/internal/core/session/throttling/ConcurrencyLimitingRequestThrottler.java | Replace lock-based coordination with lock-free queue/counters. |
| core/src/main/java/com/datastax/oss/driver/internal/core/metadata/SniEndPoint.java | Prevent integer overflow in round-robin offset for address selection. |
| core/src/main/java/com/datastax/oss/driver/internal/core/loadbalancing/helper/OptionalLocalDcHelper.java | Add checks/warnings for local DC mismatches with contact points; expose configuredLocalDc(). |
| core/src/main/java/com/datastax/oss/driver/internal/core/loadbalancing/DefaultLoadBalancingPolicy.java | Add startup configuration output (for driver baggage). |
| core/src/main/java/com/datastax/oss/driver/internal/core/loadbalancing/BasicLoadBalancingPolicy.java | Add startup configuration output and safer default for routing method parsing. |
| core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandler.java | Integrate request-id generator into per-request logging/tracking and statement decoration. |
| core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlPrepareAsyncProcessor.java | Clarify/adjust behavior for cached completed futures vs defensive copies. |
| core/src/main/java/com/datastax/oss/driver/internal/core/context/StartupOptionsBuilder.java | Add DRIVER_BAGGAGE startup option built from load balancing startup configuration. |
| core/src/main/java/com/datastax/oss/driver/internal/core/context/DefaultNettyOptions.java | Remove unnecessary synchronization from getTimer(). |
| core/src/main/java/com/datastax/oss/driver/internal/core/context/DefaultDriverContext.java | Add request-id generator wiring; make startup options built dynamically per call. |
| core/src/main/java/com/datastax/oss/driver/internal/core/ContactPoints.java | Refactor contact point parsing to AddressUtils + improve logging around invalid specs. |
| core/src/main/java/com/datastax/oss/driver/internal/core/addresstranslation/SubnetAddressTranslator.java | New subnet-based address translator implementation. |
| core/src/main/java/com/datastax/oss/driver/internal/core/addresstranslation/SubnetAddress.java | New subnet-to-address mapping helper. |
| core/src/main/java/com/datastax/oss/driver/internal/core/addresstranslation/Subnet.java | New CIDR subnet parsing/contains implementation. |
| core/src/main/java/com/datastax/oss/driver/internal/core/addresstranslation/FixedHostNameAddressTranslator.java | Use DefaultDriverOption constant for advertised-hostname config. |
| core/src/main/java/com/datastax/oss/driver/api/core/tracker/RequestTracker.java | Clarify session-request vs node-request tracker callbacks + renamed parameter semantics. |
| core/src/main/java/com/datastax/oss/driver/api/core/tracker/RequestIdGenerator.java | New public API for request-id generation + default statement decoration into custom payload. |
| core/src/main/java/com/datastax/oss/driver/api/core/ssl/ProgrammaticSslEngineFactory.java | Add allowDnsReverseLookupSan option for programmatic SSL engine factory. |
| core/src/main/java/com/datastax/oss/driver/api/core/session/throttling/RequestThrottler.java | Update documentation regarding lock-free vs lock-based throttlers. |
| core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java | Add programmatic request-id generator support; default generator for secure connect bundles. |
| core/src/main/java/com/datastax/oss/driver/api/core/session/ProgrammaticArguments.java | Add storage/accessors for programmatic request-id generator. |
| core/src/main/java/com/datastax/oss/driver/api/core/loadbalancing/LoadBalancingPolicy.java | Add default startup configuration map hook. |
| core/src/main/java/com/datastax/oss/driver/api/core/context/DriverContext.java | Expose optional request-id generator from the context. |
| core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java | Add typed options for new SSL/request-id/address-translator settings. |
| core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java | Add new config keys for SAN reverse lookup, request id generator, and subnet translator. |
| core/revapi.json | Update revapi ignores for new API surface and optional dependency noise. |
| core/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| core-shaded/pom.xml | Version bump to 4.19.2.0-SNAPSHOT. |
| changelog/README.md | Add 4.19.1 and 4.19.2 changelog entries. |
| bom/pom.xml | Version bump across BOM-managed artifacts. |
Comments suppressed due to low confidence (1)
osgi-tests/src/test/java/com/datastax/oss/driver/internal/osgi/support/BundleOptions.java:44
commonBundles()now referencesjava-driver-guava-shadedunder groupIdorg.apache.cassandra, but this fork's modules (and parent POM) usecom.scylladb. This will make the OSGi test provision the wrong artifact (or fail to resolve it). Update the groupId back tocom.scylladb(or ensure the project actually publishes theorg.apache.cassandracoordinates).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #894
Summary
Merges changes from apache/cassandra-java-driver tag
4.19.2intoscylla-4.xand bumps the ScyllaDB driver version to4.19.2.0-SNAPSHOT.The last upstream merge was at Apache tag
4.19.0(PR #467).Upstream changes (4.19.0 → 4.19.2)
4.19.0 → 4.19.1
CASSJAVA-80— Support configuration to disable DNS reverse-lookups for SAN validationCASSJAVA-90— Update native-protocol versionCASSJAVA-40— Driver testing against Java 21CASSJAVA-102— Fix revapi spurious complaints about optional dependenciesCASSJAVA-97— Let users inject an ID for each request and write to the custom payloadCASSJAVA-92— Local DC provided for nodetool clientstatsCASSJAVA-89— Support schema options that changed in Cassandra 5.0SubnetAddressTranslatorfor IP translation on private networksDefaultNettyOptionsConcurrencyLimitingRequestThrottler4.19.1 → 4.19.2
CASSJAVA-116— Retry or Speculative Execution withRequestIdGeneratorthrows "Duplicate Key"Conflict resolution notes
.asf.yaml,Jenkinsfile-datastax,Jenkinsfile-asf,ci/create-user.sh,ci/run-tests.shgroupId(com.scylladb) and removed<parent>org.apache/apache</parent>ConcurrencyLimitingRequestThrottlerimplementationCqlRequestHandlerBackendType.SCYLLAand ScyllaDB-specific test infrastructureCcmBridge